﻿// -----------------------------------------------------------------------
// <copyright file="PhieuKhamBenhEntity.cs" company="">
// TODO: Copyright by dangppsoft@gmail.com.
// </copyright>
// -----------------------------------------------------------------------
namespace ManagerClinic.Core.Common
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;

    public class PhieuKhamBenhEntity
    {
        // Data type: varchar
        // Maxlenght: 50
        public string MaKhamBenh { get; set; }

        // Data type: int
        public Int32 Stt { get; set; }

        // Data type: varchar
        // Maxlenght: 50
        public string MaHoSo { get; set; }

        // Data type: varchar
        // Maxlenght: 10
        public string MaDichVu { get; set; }

        // Data type: varchar
        // Maxlenght: 50
        public string SoVaoVien { get; set; }

        public DateTime NgayVaoKham { get; set; }

        // Data type: ntext
        // Maxlenght: 1073741823
        public string LyDoKham { get; set; }

        // Data type: ntext
        // Maxlenght: 1073741823
        public string KetLuan { get; set; }

        // Data type: varchar
        // Maxlenght: 50
        public string MaBacSy { get; set; }

        // Data type: int
        public Int32 TrangThaiPhieu { get; set; }

        // Data type: varchar
        // Maxlenght: 10
        public string MaKhoa { get; set; }

        // Data type: varchar
        // Maxlenght: 10
        public string MaPhongKham { get; set; }

        public bool TrangThaiCho { get; set; }

        public string TenPhongKham { get; set; }

        public string TenKhoa { get; set; }

        public string MaLoaiDichVu { get; set; }

        const string KhamBenh = "KCB";

        const int KhamBenh_TaoMoi = 0;
        const int KhamBenh_ChoKham = 1;
        const int KhamBenhThuPhi = 2;
        const int KhamBenh_HoanTat = 3;

        const int CanLamSang_TaoMoi = 0;
        const int CanLamSang_ThuPhi = 2;
        const int CanLamSang_CanLamSang = 3;
        const int CanLamSang_TroLaiPhongKham = 4;
        const int CanLamSang_KetThuc = 5;

        string trangThaiPhieuText = string.Empty;
        public string TrangThaiPhieuText
        {
            get
            {
                if (MaLoaiDichVu == KhamBenh)
                {
                    if (TrangThaiPhieu == KhamBenh_TaoMoi)
                    {
                        trangThaiPhieuText = "Tạo mới";
                    }
                    else if (TrangThaiPhieu == KhamBenhThuPhi)
                    {
                        trangThaiPhieuText = "Thu phí";
                    }
                    else if (TrangThaiPhieu == KhamBenh_ChoKham)
                    {
                        trangThaiPhieuText = "Chờ khám";
                    }
                    else
                    {
                        trangThaiPhieuText = "Hoàn tất";
                    }
                }
                else
                {
                    if (TrangThaiPhieu == CanLamSang_TaoMoi)
                    {
                        trangThaiPhieuText = "Tạo mới";
                    }
                    else if (TrangThaiPhieu == CanLamSang_ThuPhi)
                    {
                        trangThaiPhieuText = "Thu phí";
                    }
                    else if (TrangThaiPhieu == CanLamSang_CanLamSang)
                    {
                        trangThaiPhieuText = "Cận lâm sàng";
                    }
                    else if (TrangThaiPhieu == CanLamSang_TroLaiPhongKham)
                    {
                        trangThaiPhieuText = "Về phòng khám";
                    }
                    else
                    {
                        trangThaiPhieuText = "Hoàn tất";
                    }
                }
                return trangThaiPhieuText;
            }
        }
    }
}